package dian.qing.li.demo.security.constants;

import org.springframework.lang.Nullable;

import java.util.HashMap;
import java.util.Map;

public enum RedisKey {
    /**
     * 请求权限列表
     */
    AUTH_REQUEST_LIST,
    /**
     * 验证码
     */
    VERIFY_CODE,
    /**
     * 用户详情
     */
    LOGIN_USER,
    /**
     * JSON WEB TOKEN
     */
    JWT,
    /**
     * 用户锁定
     */
    LOGIN_LOCKED,
    /**
     * 编码
     */
    CODE,
    ;

    private RedisKey() {
    }

    public static RedisKey resolve(@Nullable String code) {
        return code != null ? redisKey.get(code) : null;
    }

    private static final Map<String, RedisKey> redisKey = new HashMap(16);

    static {
        RedisKey[] var0 = values();
        int var1 = var0.length;
        for (int var2 = 0; var2 < var1; ++var2) {
            RedisKey key = var0[var2];
            redisKey.put(key.name(), key);
        }
    }

    @Override
    public String toString() {
        return this.name();
    }
}
